UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ED+fDRTGa/o2SqpD7UA0C4jj1u0zDna9xxCgjCttHSk='
WHERE
key_id = 'dadd4d7070b9310d243bb927795a06f36cec1cb0a2a9e3f82b3b5eb745d81974'
AND (
token = 'ED+fDRTGa/o2SqpD7UA0C4jj1u0zDna9xxCgjCttHSk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)