UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Ig8EqDLuBsD/etyzfqFrm5h0zS9wYHj2dUfO5IsPjY=' 
WHERE 
  key_id = '2459b88ccea48d827247df994b8be4adf046536cde7495b4ed69fde551467460' 
  AND (
    token = '0Ig8EqDLuBsD/etyzfqFrm5h0zS9wYHj2dUfO5IsPjY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028