UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GNIVpP5v31/GAFfiDakRxC24EnKJokxgkr7kGQgs+yw='
WHERE
key_id = '39f27f462fd0cac6e528b7b25c882f8024180ff1ded6958052ada691026748fd'
AND (
token = 'GNIVpP5v31/GAFfiDakRxC24EnKJokxgkr7kGQgs+yw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)