UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O/JWeEhGy8oiZfV92sfJfL0NEB7gddPmNCSlkJUBNa4=' 
WHERE 
  key_id = 'a1fa67d1453325eec39d68fe504d1ee925372226423896c078fb217354c9e983' 
  AND (
    token = 'O/JWeEhGy8oiZfV92sfJfL0NEB7gddPmNCSlkJUBNa4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026