UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6iicdoj0Fu4CWJyIgPzaR85Qtsut0Ef2xhrkoWZQy1k=' 
WHERE 
  key_id = 'd57f20463b24548d322eda5b957018cbb827951fcaf0ec74a989f748a2c4b48f' 
  AND (
    token = '6iicdoj0Fu4CWJyIgPzaR85Qtsut0Ef2xhrkoWZQy1k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016