UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0PoCD7gX3bPFTeoIpkWr5UG/PU1ZVcxlzGAG8CFqBkw=' 
WHERE 
  key_id = '487428de3ceab304a4f92b1dae87dc0801750ef5623a5258d922670191ef97d9' 
  AND (
    token = '0PoCD7gX3bPFTeoIpkWr5UG/PU1ZVcxlzGAG8CFqBkw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034