UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8xP7ozi5+8pshidPWBTgHP8gaSnnrhaSm9q/q+tqxvo='
WHERE
key_id = '081014a243abc16c5e2944622bb0d071cc3044d10c1679593c8f3be285d8bcf5'
AND (
token = '8xP7ozi5+8pshidPWBTgHP8gaSnnrhaSm9q/q+tqxvo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)