UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g/j3yI8v2WkfdmjEzo33LQV33IGJHm2QQYUZ7lfTXoA='
WHERE
key_id = 'ecf1127fdaf29b099d0e593ba2d47e011a0c381c775182bb1040060347b6bf4a'
AND (
token = 'g/j3yI8v2WkfdmjEzo33LQV33IGJHm2QQYUZ7lfTXoA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)