UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XqaVmJPASH/R+X7BrR4F9iQ/oRihVrrH9bNQUfAvmfI=' 
WHERE 
  key_id = '2b29b174b2511ac38f1bbf9678ee0a5a3897c050dd8dffc2f009c534fbfe453e' 
  AND (
    token = 'XqaVmJPASH/R+X7BrR4F9iQ/oRihVrrH9bNQUfAvmfI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029