UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fFiTbJmtmnmBZ95D0RTXPSu4myDyiV99/HSeTu15Crs='
WHERE
key_id = '030c89e9fba58bdd0cb088bc3a2829b50de76993bb42fd787cedea4ef82ebffc'
AND (
token = 'fFiTbJmtmnmBZ95D0RTXPSu4myDyiV99/HSeTu15Crs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)