UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tnmz617bC1RWa+ySy/Yksl5h4eYmc4W6dwyw5QktkAg='
WHERE
key_id = '7c4b6fe644b7774aecd410025c1bac3bf803822a21cdaa3514a65573cecb9e44'
AND (
token = 'Tnmz617bC1RWa+ySy/Yksl5h4eYmc4W6dwyw5QktkAg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)