UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X+eEyMI5/RGEsnCqakcilK5P6bSEdasdrQ0Lp9d5aPg='
WHERE
key_id = 'bb372a0d8ffaa6e2c356809b011165007e00403df5a76407f951ce5afbb8975e'
AND (
token = 'X+eEyMI5/RGEsnCqakcilK5P6bSEdasdrQ0Lp9d5aPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)