UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IS3NeBqRQA2MIiYynvU+E5R6LB/yEEzu2SUTG4Ia63s='
WHERE
key_id = 'a6a52de72edcb73549e615d8ed5d57a4d90acd14c4b2b2b17036e54bdb43eb9e'
AND (
token = 'IS3NeBqRQA2MIiYynvU+E5R6LB/yEEzu2SUTG4Ia63s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)