UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QyvWGwfCDEkgq4ENqUUm4Ov+71ufdERzNr0g5fjRlAg=' 
WHERE 
  key_id = '6d4efc3ef9ebb11457ce4d656aa5fe43d5c6e75f80ee11e97d8653afb5854980' 
  AND (
    token = 'QyvWGwfCDEkgq4ENqUUm4Ov+71ufdERzNr0g5fjRlAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057