UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iFlaU/lrkHpP58NzcEjUrl8buqck6dhVfMiUK+uGR88='
WHERE
key_id = '214efa0c77a9784649f9123a955cb110b439d0b9802feae0619ab024e3ebb2a1'
AND (
token = 'iFlaU/lrkHpP58NzcEjUrl8buqck6dhVfMiUK+uGR88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)