UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qaaBR0TGQ48wVBEn/qByqAM1lFyXUk6f4Y4DOirRx0Q='
WHERE
key_id = 'b1b4c5c0087bfeefd66c473487c322efc70fee7f14664ee82d337dd0d00e4b58'
AND (
token = 'qaaBR0TGQ48wVBEn/qByqAM1lFyXUk6f4Y4DOirRx0Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)