UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7PiorhDvuiqTrH3dsehcgsr8e76hjJnLGRe5dpvNHjo='
WHERE
key_id = 'a27db1c9e97183749be99dc39d17f3ecd5576fffc5362dc5cae008abc10327d7'
AND (
token = '7PiorhDvuiqTrH3dsehcgsr8e76hjJnLGRe5dpvNHjo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)