UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4pKXEzK4uWVA0O5x24Qs2iLQqlXOZZjOG0c4nDf8TQk='
WHERE
key_id = '17be8b0572b44bb789358935eaa69615091ea08c3aef238973bb0446280a1f5f'
AND (
token = '4pKXEzK4uWVA0O5x24Qs2iLQqlXOZZjOG0c4nDf8TQk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)