UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OwVG4qjD40qB4Zl04Mr4JKZAb95aZTYVluku821wq0k=' 
WHERE 
  key_id = 'fcc5f861a25f86f077f1c1e87cb94221a1f26079f1017b9c0cdd826f5935c7ba' 
  AND (
    token = 'OwVG4qjD40qB4Zl04Mr4JKZAb95aZTYVluku821wq0k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046