UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8MayzV0ZAcXJks6zDciKEgwDQZGUSi151AcFyFug9Bw='
WHERE
key_id = 'ebd5d4206f47da52634bdc91d2f00eb64fa6c1a2cbab233169aedd929b9943da'
AND (
token = '8MayzV0ZAcXJks6zDciKEgwDQZGUSi151AcFyFug9Bw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)