UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1t/Ue6j5Tx5WqODpwG4fxQaEVXzmubi9UprgGmOby88='
WHERE
key_id = '929361929217a131e23aa543a09f3bab3eabbeb5939ba45166d9ed2f7cbd9117'
AND (
token = '1t/Ue6j5Tx5WqODpwG4fxQaEVXzmubi9UprgGmOby88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)