UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mK78mitXN4HXEdEcA+vj8hK2nqCbtUDkgZOFAQ3kxTQ=' 
WHERE 
  key_id = '91a468ee5ba1c1c1e0463a92d2c0112042230f919ad506d5fe14711131c2af44' 
  AND (
    token = 'mK78mitXN4HXEdEcA+vj8hK2nqCbtUDkgZOFAQ3kxTQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045