UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a/UySHy846NWWmsE1xmZDX+hsfnQJXk03YvOvynX5S4=' 
WHERE 
  key_id = '43e2078f44e6bcefd1dfd4484d74c6774b692c45d5927ffed545a687645f04c9' 
  AND (
    token = 'a/UySHy846NWWmsE1xmZDX+hsfnQJXk03YvOvynX5S4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039