UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DjVyofp9uGbO3gjSrBD8Hgtah4kYKuLZ6dLG9fZFPH4=' 
WHERE 
  key_id = '8e6974abc305b796efd4b9469160eb1b543d8b6c09d14463ded577401a451cba' 
  AND (
    token = 'DjVyofp9uGbO3gjSrBD8Hgtah4kYKuLZ6dLG9fZFPH4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031