UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hv+ceydrxNfooXhs+diq5PghEpBMC4lZj0YD7GtAHRk='
WHERE
key_id = '38c0d8e0adc931488f8e0a83490a47152fe62df3a38a9f5fe325ddb073821b81'
AND (
token = 'Hv+ceydrxNfooXhs+diq5PghEpBMC4lZj0YD7GtAHRk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)