UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+a8yq3gFnDAXWkcnAV8n9UAX04Uk4JSqfbfmokEamEE=' 
WHERE 
  key_id = 'df75e36b490c4e932e471d4c3f8e68d1a641d54104b5a164c5c53290ebb21a80' 
  AND (
    token = '+a8yq3gFnDAXWkcnAV8n9UAX04Uk4JSqfbfmokEamEE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036