UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nyMvQTmF0+F5OECsXqC1d7X2qYZC+P+q83nm7H2ovuY='
WHERE
key_id = '7ac48334bc9934c1f3e6202fed9ac8af7089498f2b747680c9b3642c96203d15'
AND (
token = 'nyMvQTmF0+F5OECsXqC1d7X2qYZC+P+q83nm7H2ovuY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)