UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QX2m83w1vbcvfBGXkuzstF5spZSBSQ1Em/sNAC5XQ7Y=' 
WHERE 
  key_id = '990dd6515c35b058f46487586198f6b64135f8f174e30cfa02b8ed8942706fdb' 
  AND (
    token = 'QX2m83w1vbcvfBGXkuzstF5spZSBSQ1Em/sNAC5XQ7Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039