UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qAC/9fdxz4ex1l1s+brjXgLJ604tFjpUEx2QEzvu1qY=' 
WHERE 
  key_id = '38e43abf74bdd9bd5bb36e200e7a57d640b44a20ebbd9addc832bd938447cc62' 
  AND (
    token = 'qAC/9fdxz4ex1l1s+brjXgLJ604tFjpUEx2QEzvu1qY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031