UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6/cftfeyNDjKUU2O+LDTrkfyuSkCIUAQZdzHhLu7veo='
WHERE
key_id = '6e12cb37dddd1cc4c782c478398ab5fec58324acfe884cff20dbbc22725048fd'
AND (
token = '6/cftfeyNDjKUU2O+LDTrkfyuSkCIUAQZdzHhLu7veo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)