UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jN/mfW8/PONb/KeNvCGJL9AOoV+ktsFtrRUAIP13a/0='
WHERE
key_id = 'c6c31a8503d399aeafe823f265314336a064be516b23c683c83a7e01c2fa0069'
AND (
token = 'jN/mfW8/PONb/KeNvCGJL9AOoV+ktsFtrRUAIP13a/0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)