UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FrLAEXlZMV7j013x13K5jk9HCKoqiw3qy3AZJ+NwmE8='
WHERE
key_id = '14ab2d870dc34f3916a36a045cb9a82a5cd84fb55a7c9ea6cb0b3d52273a496a'
AND (
token = 'FrLAEXlZMV7j013x13K5jk9HCKoqiw3qy3AZJ+NwmE8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)