UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4cBP94bv5q8Oq4ZdwfYYcqzSujQFMciZGEl5K6E6dmY='
WHERE
key_id = '4125bdeede7c6af60fbcee45297349d894eb3ee0c0d240bd094f7f6d10d6fe1e'
AND (
token = '4cBP94bv5q8Oq4ZdwfYYcqzSujQFMciZGEl5K6E6dmY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)