UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kkeHOlbRY95CmbbtXDBV1D/ml1990sbAumcxCWIhhYE='
WHERE
key_id = '1ca61e041839ce0d465922452c4e0c6e842714e2e7ad8bfbc1934bdb31452b1f'
AND (
token = 'kkeHOlbRY95CmbbtXDBV1D/ml1990sbAumcxCWIhhYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)