UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r6l4i3xVzefmihqV+WISJ62J+/OLn59EBDu1w5yQjuQ=' 
WHERE 
  key_id = 'b0b4cf54a1ffbccbd13275527f6db85a0daff28f58da18f58e200589a36a7dae' 
  AND (
    token = 'r6l4i3xVzefmihqV+WISJ62J+/OLn59EBDu1w5yQjuQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032