UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u+cSL8v0U72yeRu3kmJh4RJmm7yjXJ3I3cbUaRf8eNw=' 
WHERE 
  key_id = '786f61c455ae9d8e6031a099b71ef55830db66d9b88cfa6ae9943fc2112d3522' 
  AND (
    token = 'u+cSL8v0U72yeRu3kmJh4RJmm7yjXJ3I3cbUaRf8eNw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021