UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BElta9d1azFHhDaXXe9vFuDNuEJS8/qIc1y4/oGNpxI='
WHERE
key_id = '2b83e2c934f418e3bf90cb5ffa10457e4cf98f160e743dba838ff2ec930e0794'
AND (
token = 'BElta9d1azFHhDaXXe9vFuDNuEJS8/qIc1y4/oGNpxI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)