UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j+L11jQ92uEL83nDt7uj/zT4ol86Mu95twqsKDUWbbg='
WHERE
key_id = '4291122eeb29cb4b174c9d8738e45aa6c2db2357592d0974c55d302921fd0c76'
AND (
token = 'j+L11jQ92uEL83nDt7uj/zT4ol86Mu95twqsKDUWbbg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)