UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a0sQWGzoXIwE8vSjGB5sWyU7R8H6TimsZOzNMNGeFvo='
WHERE
key_id = '2d09c2a274f2814b08612e14e6ea814944dd77c8dc0b3f7c67fbddc17e1401db'
AND (
token = 'a0sQWGzoXIwE8vSjGB5sWyU7R8H6TimsZOzNMNGeFvo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)