UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't34+izr79jojhJTkv17tNcck2stRazcsxi1KbL6cHqE='
WHERE
key_id = 'db8b0dbf246b6f71f25d8d2c2bdaab0cb9664fa17bf67bd62c52a5988994667b'
AND (
token = 't34+izr79jojhJTkv17tNcck2stRazcsxi1KbL6cHqE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)