UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TBqVgA95kOa29FF+LEMhqF2Ae4XDF3bPuEPz0Pr/lwY='
WHERE
key_id = '28c52b88e284bea3f784e5ab27724c92f487b0c3c7be02ac8fc9a8d8c2ebb27b'
AND (
token = 'TBqVgA95kOa29FF+LEMhqF2Ae4XDF3bPuEPz0Pr/lwY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)